<template>
  <div class="child1">
    <h3>我是子组件1:曹植</h3>
    <button @click="handler">七步诗--传给曹丕</button>
  </div>
</template>

<script setup lang="ts">
import $bus from "../../bus";
// console.log($bus)
//组合式API函数
// 点击按钮回调 
const handler=()=>{
  $bus.emit('poem',{poem:'七步诗'})
}

</script>

<style scoped>
.child1 {
  width: 300px;
  height: 300px;
  background: rgb(227, 188, 208);
}
</style>